home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / math / gle-3.000 / gle-3 / gle / memmove.c < prev    next >
C/C++ Source or Header  |  1995-02-07  |  317b  |  20 lines

  1. /*
  2.  * memmove, copy overlapping strings
  3.  *
  4.  * We supply this routine for those systems that aren't standard yet.
  5.  */
  6.  
  7. char *memmove(char *dest, char *src, int l)
  8. {
  9.     char *ret = dest;
  10.  
  11.     if (dest<src) {
  12.         while (l--) *dest++ = *src++;
  13.     } else {
  14.         dest+=l; src+=l;
  15.         while (l--) *(--dest) = *(--src);
  16.     }
  17.     return ret;
  18. }
  19.  
  20.